package cn.cybozu.api;

public class CybozuUser
{
	private String name;
	private String code;
	
	public String getCode()
	{
		return code;
	}
	public void setCode(String code)
	{
		this.code = code;
	}
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	@Override
	public int hashCode()
	{
		if(code == null)
		{
			return 0;
		}
		else
		{
			return code.hashCode();
		}
	}
	@Override
	public boolean equals(Object user)
	{
		if(user.getClass() != this.getClass())
		{
			return false;
		}
		if(this.getCode() == null)
		{
			return false;
		}
		if(((CybozuUser)user).getCode() == null)
		{
			return false;
		}
		return this.getCode().equals(((CybozuUser)user).getCode());
	}
}
